# -*- coding:utf-8 -*-
import os


class BaseConfig:
    '''
    Base configration
    '''
    DEBUG = False
    TESTING = False
    SQLALCHEMY_TRACK_MODIFICATIONS = False
    SECRET_KEY = 'my_precious'


class DevelopmentConfig(BaseConfig):
    """
    开发模式配置
    """
    DEBUG = True
    SQLALCHEMY_DATABASE_URI = os.getenv('DATABASE_URI')


class DebugConfig(BaseConfig):
    """
    调试模式配置
    """
    DEBUG = True
    # SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URI')
    SQLALCHEMY_DATABASE_URI = 'postgres://postgres:postgres@127.0.0.1:5432/app_dev'


class TestingConfig(BaseConfig):
    """
    测试配置
    """
    DEBUG = True
    TESTING = True
    SQLALCHEMY_DATABASE_URI = os.getenv('DATABASE_TEST_URI')


class ProductionConfig(BaseConfig):
    """
    生产配置
    """
    DEBUG = False
    SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_TEST_URI')
